From: Florian Müllner Date: Mon, 10 Jul 2023 03:56:34 +0000 (+0200) Subject: extensionBase: Set up translations automatically X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~337^2~1^2~91 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0483dd31f0107418a83e9c04f38f03b1a2132114;p=gnome-shell.git extensionBase: Set up translations automatically If an extension provides the gettext domain in its metadata, then we can simply set up translations from the constructor, so do that for a bit more convenience. Part-of: --- diff --git a/js/extensions/sharedInternals.js b/js/extensions/sharedInternals.js index 2f8e28710..524ec3985 100644 --- a/js/extensions/sharedInternals.js +++ b/js/extensions/sharedInternals.js @@ -55,6 +55,10 @@ export class ExtensionBase { throw new Error(`${this.constructor.name} did not pass metadata to parent`); this.metadata = metadata; + + const domain = this.metadata['gettext-domain']; + if (domain) + this.initTranslations(domain); } /**